package com.personal.system.controller.content;

import com.personal.common.result.Result;
import com.personal.system.entity.content.WebConfig;
import com.personal.system.service.content.web.WebConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/webConfig")
@Api(tags = "网站配置管理")
@RequiredArgsConstructor
public class WebConfigController {

    private final WebConfigService webConfigService;

    @GetMapping(value = "/list")
    @ApiOperation(value = "网站配置列表", httpMethod = "GET", response = Result.class, notes = "网站配置列表")
    public Result list() {
        return webConfigService.listWebConfig();
    }

    @PostMapping(value = "/update")
    @ApiOperation(value = "修改网站配置", httpMethod = "POST", response = Result.class, notes = "修改网站配置")
    public Result update(@RequestBody WebConfig webConfig) {
        return webConfigService.updateWebConfig(webConfig);
    }
}